﻿using Modbus.Device;
using System.IO.Ports;

namespace IntoCommon.Protocol
{
    public class ModbusRtu
    {
        public IModbusMaster Master;
        public void Create()
        {
            SerialPort serialPort = new SerialPort();
            serialPort.PortName = "COM1";
            serialPort.BaudRate = 9600;
            serialPort.DataBits = 8;
            serialPort.Parity = Parity.None;
            serialPort.StopBits = StopBits.One;
            serialPort.Open();
            Master = ModbusSerialMaster.CreateRtu(serialPort);       
        }

    }
}
